package org.summerframework.component.security.spring.config;

import org.summerframework.component.security.spring.matcher.RoleRequestMatcher;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.util.matcher.RequestMatcher;

/**
 * @author 石超
 * @version v1.0.0
 */
@Getter
@Setter
@ConfigurationProperties("spring.login.security")
public class SecurityProperties {
    private boolean enable = true;

    private boolean isAny = false;

    private boolean crsf = false;

    private Class<? extends RequestMatcher> requestMatcherClass = RoleRequestMatcher.class;

    private String[] patterns;

    private boolean login = true;

    private boolean logout = true;

    private boolean requestContext = true;

    private Integer maximumSessions = 1;

    private String[] ignoring;

    private boolean enableRoleRequired = true;

    private SessionCreationPolicy sessionMode = SessionCreationPolicy.IF_REQUIRED;
}
